package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.service.IServiceMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ServiceMainMapper;
import com.ruoyi.domain.ServiceMain;

/**
 * 服务列表Service业务层处理
 * 
 * @author jack
 * @date 2025-01-10
 */
@Service
public class ServiceMainServiceImpl implements IServiceMainService
{
    @Autowired
    private ServiceMainMapper serviceMainMapper;

    /**
     * 查询服务列表
     * 
     * @param id 服务列表主键
     * @return 服务列表
     */
    @Override
    public ServiceMain selectServiceMainById(Long id)
    {
        return serviceMainMapper.selectServiceMainById(id);
    }

    /**
     * 查询服务列表列表
     * 
     * @param serviceMain 服务列表
     * @return 服务列表
     */
    @Override
    public List<ServiceMain> selectServiceMainList(ServiceMain serviceMain)
    {
        return serviceMainMapper.selectServiceMainList(serviceMain);
    }

    /**
     * 新增服务列表
     * 
     * @param serviceMain 服务列表
     * @return 结果
     */
    @Override
    public int insertServiceMain(ServiceMain serviceMain)
    {
        serviceMain.setCreateTime(DateUtils.getNowDate());
        return serviceMainMapper.insertServiceMain(serviceMain);
    }

    /**
     * 修改服务列表
     * 
     * @param serviceMain 服务列表
     * @return 结果
     */
    @Override
    public int updateServiceMain(ServiceMain serviceMain)
    {
        return serviceMainMapper.updateServiceMain(serviceMain);
    }

    /**
     * 批量删除服务列表
     * 
     * @param ids 需要删除的服务列表主键
     * @return 结果
     */
    @Override
    public int deleteServiceMainByIds(Long[] ids)
    {
        return serviceMainMapper.deleteServiceMainByIds(ids);
    }

    /**
     * 删除服务列表信息
     * 
     * @param id 服务列表主键
     * @return 结果
     */
    @Override
    public int deleteServiceMainById(Long id)
    {
        return serviceMainMapper.deleteServiceMainById(id);
    }
}
